﻿using System;

namespace MobileCommissionManagement.Framework
{
    public static class DatabaseTools
    {
        public static Type GetTypeOf(int systemTypeId)
        {
            switch(systemTypeId)
            {
                case 34:
                case 165:
                case 173:
                    return typeof(byte[]);
                case 35:
                case 99:
                case 167:
                case 175:
                case 231:
                case 239:
                case 241:
                    return typeof(string);
                case 36:
                    return typeof(Guid);
                case 48:
                    return typeof (byte);
                case 52:
                    return typeof (short);
                case 56:
                    return typeof (int);
                case 58:
                    return typeof(DateTime);
                case 59:
                    return typeof(float);
                case 60:
                case 106:
                case 108:
                case 122:
                    return typeof(decimal);
                case 61:
                    return typeof(DateTime);
                case 62:
                    return typeof(double);
                case 98:
                    return typeof(object);
                case 104:
                    return typeof(bool);
                case 127:
                case 189:
                    return typeof(long);
                default:
                    throw new Exception("O tipo '" + systemTypeId + "'não é suportado.");
            }
        }
    }
}
